<template>
  <div>
    {{ objectData.name }}
    {{ objectData.age }}
    {{ name }}
  </div>
</template>

<script>
export default {
  props: {
    objectData: {
      type: Object,
      default: () => ({
        name: '少年',
        age: 23
      })
    },
    name: {
      type: String,
      default: "我是默认值"
    }
  },
  watch: {
    objectData: {
      handler(newVal, oldVal) {
        // console.log(newVal)
        // console.log(oldVal)
      }
    },
    name: {
      handler(newVal, oldVal) {
        console.log("新值",newVal)
        console.log("旧值",oldVal)
      }
    }
  }
}
</script>

<style></style>
